package com.gp.common;

import java.io.IOException;

import org.springframework.http.HttpOutputMessage;
import org.springframework.http.converter.HttpMessageNotWritableException;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;

/**
 * @author: 弓成龙
 * @date  : 2017年12月14日
 * @email : gcx909109@sina.cn
 * @description: 
 */
public class FastJsonHttpMessageConverterEx extends FastJsonHttpMessageConverter {

  @Override
  protected void writeInternal(Object arg0, HttpOutputMessage arg1)
      throws IOException, HttpMessageNotWritableException {
    JSON.DEFFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    JSON.toJSONString(arg0,SerializerFeature.WriteDateUseDateFormat);
    super.writeInternal(arg0, arg1);
  }
}
